Repository navigation
beast: set_server_name is [[nodiscard]], and beast asks for the nodiscard results rule - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
boost::system::resultcarries no[[nodiscard]]of its own, so a caller that drops whatset_server_namereturns would not see a refused server name and would connect without the SNIit asked for. The member and the free function are now
[[nodiscard]], and meta/lint.json asksfor the superproject's
nodiscard resultslint rule, which keeps every function ofinclude/that returns
boost::system::resultso.The branch sits on
main(handshake-limit included). The superproject records this commit aslibs/beastin webcpporg/webcpp's nodiscard/v0.1 pull request, which merges after the crypto andhash ones.
Changes
[[nodiscard]]onssl_stream::set_server_nameand the free
set_server_name(Doc Comments unchanged)."nodiscard-results"and its reason.Verification
Emscripten and gcc-15 lanes compile beast's tests and examples with warnings as errors and report
no discarded result, from scratch, in the superproject's nodiscard/v0.1 tree with this commit
recorded: native 28, wasip2 27, wasip3 28, Emscripten 28, gcc-15 28 tests passed, 0 failed.
nodiscard resultsincluded:lint: clean(2267 compilecommands).
🤖 Generated with Claude Code